<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <title>thymeleaf 测试页面</title>
    <meta charset="UTF-8">
    <!-- 去掉注释块的内容 -->
    <!--/* 这些代码会被引擎解析时去掉 */-->
    <script th:inline="javascript">
        /*<![CDATA[*/
            var sex = /*[[${user.name}]]*/; //null
            console.log("hello world!");
        /*[+
            var msg = 'This is a working application'; //增加代码
        +]*/

        /*[-
            var x = 23; //减少代码
        -]*/

        /*]]>*/
    </script>
    <!--/*/
        </th:block> 保留注释块里面的内容
    /*/-->
</head>
<body>
    <div th:unless="${#lists.isEmpty(#request.getAttributeNames())}"></div>
        <p th:text="${session.size()}">123</p>
        <p th:inline="text">Hello, [[${user.name}]] </p>
        <p th:text="${#request.getAttributeNames().hasMoreElements()}">attribute</p>
        <p th:text="${user.email}">username</p>
        <p th:text="${user.userName}"></p>
        <p th:text="${a + b + c}"></p>
    </div>
    <p th:text="${id}">3</p>
    <div th:text="${#locale.getLanguage()}"></div>
    <div th:text="${#dates.createNow().toLocaleString()}"></div>
</body>
</html>